package com.chendx.store.goods.controller;

import com.chendx.model.common.dtos.ResponseResult;
import com.chendx.model.goods.dto.GoodsDto;
import com.chendx.store.api.goods.CoodsControllerApi;
import com.chendx.store.goods.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by chendx on 2022/4/18.
 */
@RestController
@RequestMapping("/api/goods")
public class GoodsController implements CoodsControllerApi {

    @Autowired
    private GoodsService goodsService;

    @Override
    @PostMapping("/save")
    public ResponseResult add(@RequestBody GoodsDto dto) {
        return goodsService.saveGoods(dto);
    }
}
